package com.ay.weixin.fdc.admin.superadmin.db;

import java.sql.SQLException;

import lizar.db.ibatis.Dao;

import com.ay.weixin.fdc.admin.superadmin.domain.SuperAdmin;

public class IbatisSuperAdminDao extends Dao{
	
	public void insert(String  name,String password) throws SQLException{
		SuperAdmin a=new SuperAdmin();
		a.setName(name);
		a.setPassword(password);
		this.sqlMapper.insert("superadmin.insert",a);
	}
	
	public void insert(SuperAdmin adm) throws SQLException{
		this.sqlMapper.insert("superadmin.insert",adm);
	}
	
	public boolean name_exists(String name) throws SQLException{
		
		return this.sqlMapper.queryForObject("superadmin.name_exists",name)!=null;
	}
	
	public SuperAdmin get(String name) throws SQLException{
		return (SuperAdmin)this.sqlMapper.queryForObject("superadmin.get",name);
	}
}
